//
//  UIEdgeInsets_Ex.swift
//  Dawn
//
//  Created by cuicheng on 2021/9/26.
//

import UIKit

extension UIEdgeInsets {
    var vertical: CGFloat {
        return (top + bottom)
    }
    
    var horizontal: CGFloat {
        return (left + right)
    }
    
    public init(x: CGFloat = 0 , y: CGFloat = 0) {
        self.init(top: y, left: x, bottom: y, right: x)
    }

    public init(top: CGFloat) {
        self.init(top: top, left: 0, bottom: 0, right: 0)
    }
    
    public init(bottom: CGFloat) {
        self.init(top: 0, left: 0, bottom: bottom, right: 0)
    }
    
    public init(left: CGFloat) {
        self.init(top: 0, left: left, bottom: 0, right: 0)
    }
    
    public init(right: CGFloat) {
        self.init(top: 0, left: 0, bottom: 0, right: right)
    }
    
}
